//判断大于和果实的距离
function momFruitsCollision()
{
	for(var i=0;i<fruit.num;i++)
	{
		if(fruit.alive[i])
		{
			//calculate length
			var l=calLength2(fruit.x[i],fruit.y[i],mom.x,mom.y);
			if(l<900)
			{
				//fruit eaten
				fruit.dead(i);
				data.fruitNum++;
				mom.momBodyCount++;
				if(mom.momBodyCount>7)
				{
					mom.momBodyCount=7;
				}
				if(fruit.fruitType[i]=="blue")
				{
					data.double=2;
				}
				wave.born(fruit.x[i],fruit.y[i],0);
			}
		}
	}
}

//mom baby collision
function momBabyCollision()
{
	var l=calLength2(mom.x,mom.y,son.x,son.y);
	if(l<900)
	{
		if(mom.momBodyCount>0)
		{
			//baby recover
			son.bodyCount=0;
			mom.momBodyCount=0;
			
			//score update
			data.addScore();
			wave.born(son.x,son.y,1);
		}		
	}
}